<template>
  <div>
    <h1>sonB</h1>
  </div>
</template>

<script>
import PubSub from "pubsub-js";
/* 
需求 sonB 要10元
订阅

sonA 发布 给10元
*/
export default {
  created() {
    PubSub.subscribe("giveMe", (msg, money) => {
      console.log(money);
    });
  },
};
</script>

<style lang="scss" scoped>
</style>